package com.pms.context;

// 定义一个基础上下文类
public class BaseContext {

    // 定义一个ThreadLocal变量，用于存储当前线程的ID
    public static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    // 设置当前线程的ID
    public static void setCurrentId(Integer id) {
        threadLocal.set(id);
    }

    // 获取当前线程的ID
    public static Integer getCurrentId() {
        return threadLocal.get();
    }

    // 移除当前线程的ID
    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
